//
//  AppDelegate+RootViewController.m
//  jiaKaoZhuShou
//
//  Created by 金艺社 on 2018/5/3.
//  Copyright © 2018年 金艺社. All rights reserved.
//

#import "AppDelegate+RootViewController.h"
#import "homePageVC.h"
#import "BaseNavigationConler.h"
@implementation AppDelegate (RootViewController)

- (void)setRootViewController
{
    UIViewController *rootVC;
     rootVC = [homePageVC new];
//    if ([[NSUserDefaults standardUserDefaults] objectForKey:@"token"] != nil && ![[[NSUserDefaults standardUserDefaults] objectForKey:@"token"] isEqualToString:@""]) {
//        rootVC = [homePageVC new];
//    }else {
//        rootVC = [logInVCViewController new];
//    }
    BaseNavigationConler * navc = [[BaseNavigationConler alloc] initWithRootViewController:rootVC];
    self.window.rootViewController = navc;
}

- (void)setTabbarController
{

}

- (void)setAppWindows
{
    [[UIApplication sharedApplication]setStatusBarHidden:NO];
    [[UIApplication sharedApplication]setStatusBarStyle:UIStatusBarStyleLightContent];
    //设置 NavigationBar title和font
    [[UINavigationBar appearance] setTitleTextAttributes:@{NSFontAttributeName:[UIFont boldSystemFontOfSize:17], NSForegroundColorAttributeName: [UIColor blackColor]}];
    [[UINavigationBar appearance] setBarTintColor:[UIColor whiteColor]]; //navigationBar 背景颜色
    [[UINavigationBar appearance] setTintColor:[UIColor blackColor]]; //navigationBar 按钮颜色
    [[UINavigationBar appearance] setShadowImage:[UIImage new]];
    [[UINavigationBar appearance] setTranslucent:NO];
//    [[UIBarButtonItem appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName: [UIColor clearColor]} forState:UIControlStateNormal];//将title 文字的颜色改为透明 左右navitem 也会隐藏
//    [[UIBarButtonItem appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName: [UIColor clearColor]} forState:UIControlStateHighlighted];//将title 文字的颜色改为透明 StateHighlighted
    
    UIImage *backButtonImage = [[UIImage imageNamed:@"backPlaceholder"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 30, 0, 0)];
    [[UIBarButtonItem appearance] setBackButtonBackgroundImage:backButtonImage forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
    [[UIBarButtonItem appearance] setBackgroundImage:[UIImage imageNamed:@""] forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];


    self.window = [[UIWindow alloc] initWithFrame:kScreen];
    self.window.backgroundColor = [UIColor whiteColor];
    [self.window makeKeyAndVisible];
}


- (void)createLoadingScrollView
{
    //引导页实例
}


@end
